//package cn.com.interceptor;
//
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletResponse;
//
//import org.springframework.web.servlet.HandlerInterceptor;
//import org.springframework.web.servlet.ModelAndView;
//
///**
// * @author liufl E-mail:Huberier@allpyra.com
// * @version 创建时间：2017年8月1日 下午1:57:57
// * 类说明
// */
//public class InterceptorHandle implements HandlerInterceptor {  
//    
//  public InterceptorHandle(){  
//      System.out.println("--------------- TestUrlInterceptor initialize -------------");  
//  }  
//    
//  @Override  
//  public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)  
//      throws Exception {  
//        
////      if(request.getRequestURI().equals("/error")){  
////          System.out.println("------------------error path");  
////          //request.getRequestDispatcher("/invalidPage");  
////          response.sendRedirect("/invalidPage");  
////      }  
//      System.out.println("--------------TestUrlInterceptor work-----------------" + request.getRequestURI());  
//        
//      return true;  
//  }  
//    
//  @Override  
//  public void postHandle(  
//          HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView)  
//          throws Exception {  
//        
//      if(modelAndView == null){  
//          modelAndView = new ModelAndView("error");  
//          throw new Exception("not find this path!!!!!");  
//      }  
//      System.out.println("-------------- TestUrlInterceptor post url -----------------" + modelAndView.getViewName());  
//  }  
//    
//  @Override  
//  public void afterCompletion(  
//          HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex)  
//          throws Exception {  
//      if(ex != null){  
//          System.out.println("-------------- TestUrlInterceptor completion -----------------" + ex.getMessage());  
//      }  
//  }  
//}
//
